\(\int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx\) [145]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 101 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {12 \sin (c+d x)}{35 a^3 d}-\frac {4 \sin ^3(c+d x)}{35 a^3 d}+\frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3}+\frac {8 i \cos ^3(c+d x)}{35 d \left (a^3+i a^3 \tan (c+d x)\right )} \]

[Out]

12/35*sin(d*x+c)/a^3/d-4/35*sin(d*x+c)^3/a^3/d+1/7*I*cos(d*x+c)/d/(a+I*a*tan(d*x+c))^3+8/35*I*cos(d*x+c)^3/d/(
a^3+I*a^3*tan(d*x+c))

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {3583, 3581, 2713} \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=-\frac {4 \sin ^3(c+d x)}{35 a^3 d}+\frac {12 \sin (c+d x)}{35 a^3 d}+\frac {8 i \cos ^3(c+d x)}{35 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3} \]

[In]

Int[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^3,x]

[Out]

(12*Sin[c + d*x])/(35*a^3*d) - (4*Sin[c + d*x]^3)/(35*a^3*d) + ((I/7)*Cos[c + d*x])/(d*(a + I*a*Tan[c + d*x])^
3) + (((8*I)/35)*Cos[c + d*x]^3)/(d*(a^3 + I*a^3*Tan[c + d*x]))

Rule 2713

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 3581

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[2*d^2*
(d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + f*x])^(n + 1)/(b*f*(m + 2*n))), x] - Dist[d^2*((m - 2)/(b^2*(m + 2*n)
)), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a
^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (Integers
Q[n, m + 1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]

Rule 3583

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(b*f*(m + 2*n))), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rubi steps \begin{align*} \text {integral}& = \frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3}+\frac {4 \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^2} \, dx}{7 a} \\ & = \frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3}+\frac {8 i \cos ^3(c+d x)}{35 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {12 \int \cos ^3(c+d x) \, dx}{35 a^3} \\ & = \frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3}+\frac {8 i \cos ^3(c+d x)}{35 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {12 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{35 a^3 d} \\ & = \frac {12 \sin (c+d x)}{35 a^3 d}-\frac {4 \sin ^3(c+d x)}{35 a^3 d}+\frac {i \cos (c+d x)}{7 d (a+i a \tan (c+d x))^3}+\frac {8 i \cos ^3(c+d x)}{35 d \left (a^3+i a^3 \tan (c+d x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.42 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.75 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=-\frac {\sec ^3(c+d x) (35+84 \cos (2 (c+d x))-15 \cos (4 (c+d x))+56 i \sin (2 (c+d x))-20 i \sin (4 (c+d x)))}{280 a^3 d (-i+\tan (c+d x))^3} \]

[In]

Integrate[Cos[c + d*x]/(a + I*a*Tan[c + d*x])^3,x]

[Out]

-1/280*(Sec[c + d*x]^3*(35 + 84*Cos[2*(c + d*x)] - 15*Cos[4*(c + d*x)] + (56*I)*Sin[2*(c + d*x)] - (20*I)*Sin[
4*(c + d*x)]))/(a^3*d*(-I + Tan[c + d*x])^3)

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.84

method result size
risch \(\frac {i {\mathrm e}^{-3 i \left (d x +c \right )}}{8 a^{3} d}+\frac {i {\mathrm e}^{-5 i \left (d x +c \right )}}{20 a^{3} d}+\frac {i {\mathrm e}^{-7 i \left (d x +c \right )}}{112 a^{3} d}+\frac {3 i \cos \left (d x +c \right )}{16 a^{3} d}+\frac {5 \sin \left (d x +c \right )}{16 a^{3} d}\) \(85\)
derivativedivides \(\frac {\frac {2}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16 i}+\frac {4 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}-\frac {9 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {17 i}{4 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {8}{7 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{7}}+\frac {38}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {15}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {15}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a^{3} d}\) \(141\)
default \(\frac {\frac {2}{16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+16 i}+\frac {4 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}-\frac {9 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {17 i}{4 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {8}{7 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{7}}+\frac {38}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {15}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {15}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a^{3} d}\) \(141\)

[In]

int(cos(d*x+c)/(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/8*I/a^3/d*exp(-3*I*(d*x+c))+1/20*I/a^3/d*exp(-5*I*(d*x+c))+1/112*I/a^3/d*exp(-7*I*(d*x+c))+3/16*I/a^3/d*cos(
d*x+c)+5/16*sin(d*x+c)/a^3/d

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.62 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {{\left (-35 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 140 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 70 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 28 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 5 i\right )} e^{\left (-7 i \, d x - 7 i \, c\right )}}{560 \, a^{3} d} \]

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/560*(-35*I*e^(8*I*d*x + 8*I*c) + 140*I*e^(6*I*d*x + 6*I*c) + 70*I*e^(4*I*d*x + 4*I*c) + 28*I*e^(2*I*d*x + 2*
I*c) + 5*I)*e^(-7*I*d*x - 7*I*c)/(a^3*d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 197 vs. \(2 (87) = 174\).

Time = 0.30 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.95 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\begin {cases} \frac {\left (- 71680 i a^{12} d^{4} e^{17 i c} e^{i d x} + 286720 i a^{12} d^{4} e^{15 i c} e^{- i d x} + 143360 i a^{12} d^{4} e^{13 i c} e^{- 3 i d x} + 57344 i a^{12} d^{4} e^{11 i c} e^{- 5 i d x} + 10240 i a^{12} d^{4} e^{9 i c} e^{- 7 i d x}\right ) e^{- 16 i c}}{1146880 a^{15} d^{5}} & \text {for}\: a^{15} d^{5} e^{16 i c} \neq 0 \\\frac {x \left (e^{8 i c} + 4 e^{6 i c} + 6 e^{4 i c} + 4 e^{2 i c} + 1\right ) e^{- 7 i c}}{16 a^{3}} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))**3,x)

[Out]

Piecewise(((-71680*I*a**12*d**4*exp(17*I*c)*exp(I*d*x) + 286720*I*a**12*d**4*exp(15*I*c)*exp(-I*d*x) + 143360*
I*a**12*d**4*exp(13*I*c)*exp(-3*I*d*x) + 57344*I*a**12*d**4*exp(11*I*c)*exp(-5*I*d*x) + 10240*I*a**12*d**4*exp
(9*I*c)*exp(-7*I*d*x))*exp(-16*I*c)/(1146880*a**15*d**5), Ne(a**15*d**5*exp(16*I*c), 0)), (x*(exp(8*I*c) + 4*e
xp(6*I*c) + 6*exp(4*I*c) + 4*exp(2*I*c) + 1)*exp(-7*I*c)/(16*a**3), True))

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.64 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.18 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=\frac {\frac {35}{a^{3} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}} + \frac {525 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 1960 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 4025 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 4480 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3143 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1176 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 243}{a^{3} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{7}}}{280 \, d} \]

[In]

integrate(cos(d*x+c)/(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

1/280*(35/(a^3*(tan(1/2*d*x + 1/2*c) + I)) + (525*tan(1/2*d*x + 1/2*c)^6 - 1960*I*tan(1/2*d*x + 1/2*c)^5 - 402
5*tan(1/2*d*x + 1/2*c)^4 + 4480*I*tan(1/2*d*x + 1/2*c)^3 + 3143*tan(1/2*d*x + 1/2*c)^2 - 1176*I*tan(1/2*d*x +
1/2*c) - 243)/(a^3*(tan(1/2*d*x + 1/2*c) - I)^7))/d

Mupad [B] (verification not implemented)

Time = 6.59 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.33 \[ \int \frac {\cos (c+d x)}{(a+i a \tan (c+d x))^3} \, dx=-\frac {\left (35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,105{}\mathrm {i}-175\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,105{}\mathrm {i}-7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,77{}\mathrm {i}+43\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-13{}\mathrm {i}\right )\,2{}\mathrm {i}}{35\,a^3\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,{\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^7} \]

[In]

int(cos(c + d*x)/(a + a*tan(c + d*x)*1i)^3,x)

[Out]

-((43*tan(c/2 + (d*x)/2) + tan(c/2 + (d*x)/2)^2*77i - 7*tan(c/2 + (d*x)/2)^3 + tan(c/2 + (d*x)/2)^4*105i - 175
*tan(c/2 + (d*x)/2)^5 - tan(c/2 + (d*x)/2)^6*105i + 35*tan(c/2 + (d*x)/2)^7 - 13i)*2i)/(35*a^3*d*(tan(c/2 + (d
*x)/2) + 1i)*(tan(c/2 + (d*x)/2)*1i + 1)^7)